﻿<!--
Name:浏览历史
Page:All
-->
<div class="nbbox clearfix">
<div class="userbox">
    <div class="mt clearfix">
        <h2>{tag:登录密码}</h2>
    </div>
    <div class="mc clearfix">
    <div class="dl-table clearfix">
    <dl>
        <dt>{tag:原始密码}：</dt>
        <dd><input name="Password" id="Password" size="30" type="password" pass="true" min="notnull" class="input" /></dd>
    </dl>
    <dl>
        <dt>{tag:新密码}：</dt>
        <dd><input name="Password1" id="Password1" size="30" type="password" pass="true" min="notnull" class="input" /></dd>
    </dl>
    <dl>
        <dt>{tag:确认密码}：</dt>
        <dd><input name="Password2" id="Password2" size="30" type="password" pass="true" min="notnull" class="input" /></dd>
    </dl>
    <dl class="dl-btn">
        <dt></dt>
        <dd><a href="javascript:void(0)" onclick="setpassword();" class="btn btn-11"><s></s>{tag:提交}</a></dd>
    </dl>
    </div>
    </div>
</div>
</div>
<div class="nbbox clearfix">
<div class="userbox">
    <div class="mt clearfix">
        <h2>{tag:支付密码}</h2>
    </div>
    <div class="mc clearfix">
    <div class="dl-table clearfix">
    <%if (CurrentUser.Pay_Password != ""){ %>
    <dl>
        <dt>{tag:原始密码}：</dt>
        <dd><input name="Pay_Password" id="Pay_Password" size="30" type="password" paypass="true" min="notnull" class="input" /> <a href="<%=URL("P_UserQuestion","1")%>">{tag:忘记密码}</a></dd>
    </dl>
    <%} %>
    <dl>
        <dt>{tag:新密码}：</dt>
        <dd><input name="Pay_Password1" id="Pay_Password1" size="30" type="password" paypass="true" min="notnull" class="input" /></dd>
    </dl>
    <dl>
        <dt>{tag:确认密码}：</dt>
        <dd><input name="Pay_Password2" id="Pay_Password2" size="30" type="password" paypass="true" min="notnull" class="input" /></dd>
    </dl>
    <%
    Lebi_User_Answer user_answer = B_Lebi_User_Answer.GetModel("User_id ="+ CurrentUser.id);
    if (user_answer==null){
    %>
    <dl class="dl-btn">
        <dt></dt>
        <dd><a href="<%=URL("P_UserQuestion","")%>" class="click">{tag:请先设置安全问题}</a></dd>
    </dl>
    <%}else{ %>
    <dl class="dl-btn">
        <dt></dt>
        <dd><a href="javascript:void(0)" onclick="setpaypassword();" class="btn btn-11"><s></s>{tag:提交}</a></dd>
    </dl>
    <%} %>
    </div>
    </div>
</div>
</div>
<script type="text/javascript">
    function setpassword() {
        var Password = $("#Password").val();
        var Password1 = $("#Password1").val();
        var Password2 = $("#Password2").val();
        if (Password == "") {
            CheckNO("Password", "{tag:请输入原始密码}");
            return false;
        }
        if (Password1 == "") {
            CheckNO("Password1", "{tag:请输入新密码}");
            return false;
        }
        if (!CheckForm("pass", "span"))
            return false;
        if (Password1 != Password2) {
            CheckNO("Password1", "{tag:两次输入的密码不一致}");
            return false;
        }
        var postData = { "Password": Password, "Password1": Password1, "Password2": Password2 };
        var url = path+"/ajax/Ajax_userin.aspx?__Action=SetPassword";
        RequestAjax(url, postData, function () { MsgBox(1, "{tag:操作成功}", "?") });
    }
    function setpaypassword() {
        var Pay_Password = $("#Pay_Password").val();
        var Pay_Password1 = $("#Pay_Password1").val();
        var Pay_Password2 = $("#Pay_Password2").val();
        <%if(CurrentUser.Pay_Password!=""){ %>
        if (Pay_Password == "") {
            CheckNO("Pay_Password", "{tag:请输入原始密码}");
            return false;
        }
        <%} %>
        if (Pay_Password1 == "") {
            CheckNO("Password1", "{tag:请输入新密码}");
            return false;
        }
        if (!CheckForm("paypass", "span"))
            return false;
        if (Pay_Password1 != Pay_Password2) {
            CheckNO("Pay_Password1", "{tag:两次输入的密码不一致}");
            return false;
        }
        var postData = { "Pay_Password": Pay_Password, "Pay_Password1": Pay_Password1, "Pay_Password2": Pay_Password2 };
        var url = path+"/ajax/Ajax_userin.aspx?__Action=SetPayPassword";
        RequestAjax(url, postData, function () { MsgBox(1, "{tag:操作成功}", "?") });
    }
</script>